package com.fight.strive.sys.modules.dictionary.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fight.strive.sys.modules.common.BaseEntity;
import com.fight.strive.sys.modules.validator.StriveNotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;


@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Entity
@Table(name = "t_sys_data_dictionary",
        indexes = {
                @Index(columnList = "parentId"),
                @Index(columnList = "seq")})
@TableName("t_sys_data_dictionary")
public class DataDictionaryEntity extends BaseEntity {

    /**
     * 字典代码
     */
    @Column(unique = true)
    @StriveNotBlank(msg = "字典代码不能为空")
    private String code;

    /**
     * 字典值
     */
    @StriveNotBlank(msg = "字典名称不能为空")
    private String name;

    /**
     * 父级字典项的ID
     */
    private Long parentId;

    /**
     * 排序序号
     */
    private Double seq;
}
